class collitiondata{
	judge:string
	name:string
	judgeytpe:string
  
	public constructor(judge:string,name:string,judgeytpe:string)
	{
		this.judge=judge
		this.name=name
        this.judgeytpe=judgeytpe
	}

}


class COBJECT extends CSPRITE{
	textnumber:number
	
	resetpos:egret.Point
    background:boolean
	public constructor(name:string) {
		super()
	
		this.objname=name;
	}
	public set isbackground(a:boolean)
	{
		this.background=a;
		ASSIST.getASSIST.backgroundcount(a)
	}
	public addbitmapBytextrue(a:egret.Texture)
	{
			this.addBitmap(a);
			this.ShowOrHide(true);
		
	}
	public addMovieClickByname(name:string)
	{
		this.createMovieClipByJsonAndName(name+"_json",name+"_png")
		this.ShowOrHide(true);
	}
	public delet()
	{
		
	}
	public update()
	{
		
	}
	public gotoandplay(a:string)
	{
		if(this.movieclip[0]!=undefined)
		this.movieclip[0].gotoAndPlay(a);
	}
	public gotoandplay_loop(a:string)
	{
		if(this.movieclip[0]!=undefined)
		{
            this.movieclip[0].gotoAndPlay(a,-1)
		}
		
	}
	public SETmoviespeed(a:number)
	{
		if(this.movieclip[0]!=undefined)
		{
            this.movieclip[0].frameRate=a;
		}
	}
	public set resnmae(a:string)
	{
		this.resname=a;
	}
	public get resnmae():string
	{
		return this.resname;
	}
	public getcollitiondata():collitiondata[]
	{
		let a:collitiondata[]=[]
		for(let b=0;b<this.judge.length;b++)
		{
           let name=this.judge[b].name
		   let type=this.judgetype_tostring(this.judge[b])
		   let judge="ON"
		   a.push(new collitiondata(judge,name,type))
		}
		for(let b=0;b<this.unjudge.length;b++)
		{
			let name=this.unjudge[b].name
		    let type=this.judgetype_tostring(this.unjudge[b])
		    let judge="OFF"
		    a.push(new collitiondata(judge,name,type))
		}
		return a;
	}
	private judgetype_tostring(a:CCOLLISION):string
	{
       if(a.type==judgetype.circle)
	   {
		   return "circle_png"
	   }
	   else if(a.type==judgetype.poly)
	   {
		  switch(a.shapepoint.length)
		  {
			  case 3:return "3point_png"
			  case 4:return "4point_png"
			  case 5:return "5point_png"
		  }
	   }
	   else if(a.type==judgetype.rectangle)
	   {
		   return "rect_png"
	   }
	}
	public deletemyself()
	{
		CBASE_MANAGE.getCBASE_MANAGE.BASE_removechildbyname(this.objName)
	}
	
	public setplayer()
	{
		

	   ASSIST.getASSIST.addautomvoeassist(this);
	}
	public cancleplayer()
	{

	    ASSIST.getASSIST.removeautomoveassist(this);
	}

	public writjason()
	{
		var data={}
		var c={}
		data["name"]=[c,c,c,c,c,c,c]
		data["x"]=String(this.x)
		data["name"][0]

		egret.localStorage.setItem('obj',JSON.stringify(data))
	}
	

}
